<template>
	<view class="recordContainer" v-if="nulldata">
		<view class="dataBox" v-for="(data,index) in gameRecords" :key="index">
			<view class="box1">
				<text>{{data.name}} {{data.type == 9 || data.type == 10 || data.type == 11 ? '' : data.deviceNo}}</text>
				<text>{{data.amount}}</text>
			</view>
			<view class="box2">
				<text>{{data.create_time}}</text>
				<view v-if="data.type == 9 || data.type == 10 || data.type == 11"></view>
				<view v-else>
					<text class='field_text' v-if="data.status == 0">失败</text>
					<text v-if="data.supervise_type==1">{{data.model_name}}</text>
					<text v-if="data.supervise_type==2">{{data.dev_name}}</text>
					<text v-if="data.slot_num">-{{data.slot_num}}号位</text>
				</view>
			</view>
		</view>
		<view class="loading" :hidden="loading">
			<!-- <image src="/img/loading.png" background="cover"></image>努力加载中... -->
		</view>
		<view class="pageBottom" :hidden="pageBottom">已经到底啦</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				currentTab: 0,
				gameRecords: [],
				page: 1,
				pageSize: 20,
				loadingAll: false,
				pageBottom: true,
				nulldata: false,
				loading: true,
				pagenulldata: {},
				userId: null,
				optType: 1
			}
		},
		onLoad(options) {
			// var self = this;
			// app.getSystemInfo(function (systemInfo) {
			//   self.setData({
			//     wheight: systemInfo.windowHeight
			//   })
			// })
			// app.judgeNetwork(function (networkStatus) {
			//   if (!networkStatus) {
			//     self.setData({
			//       nulldata: false,
			//       pagenulldata: {
			//         imgurl: '/img/nointernet.png',
			//         text: ['暂无网络', '请检查网络或刷新～'],
			//         showRefresh: true
			//       }
			//     })
			//   } else {
			//     wx.getStorage({
			//       key: 'loginInfo',
			//       success: function (res) {
			//         var userId = res.data.user_id;
			//         self.setData({
			//           userId: userId
			//         })
			//         var putData = {
			//           page_no: self.data.page,
			//           page_size: self.data.pageSize,
			//           user_id: userId,
			//           optType: self.data.optType
			//         }
			//         self.getData(putData, 'onLoad');
			//       },
			//       fail: function () {
			//         self.setData({
			//           nulldata: false,
			//           pagenulldata: {
			//             imgurl: '/img/unknown.png',
			//             text: ['操作失败,未知错误~']
			//           },
			//         })
			//       }
			//     })
			//   }
			// })
		},

	}
</script>

<style>
	/* pages/myGameRecord/myGameRecord.wxss */
	page {
	  background: #f3f3f3;
	}
	
	.tip {
	  position: fixed;
	  top: 88rpx;
	  left: 0;
	  width: 100%;
	  height: 60rpx;
	  line-height: 60rpx;
	  padding-left: 20rpx;
	  color: #F96E2D;
	  font-size: 12px;
	  background: #fff
	}
	
	.recordContainer {
	  box-sizing: border-box;
	  background: #fff;
	  margin-top: 0rpx;
	}
	
	.dataBox {
	  padding: 30rpx;
	  padding-bottom: 22rpx;
	  border-bottom: 1px solid #efefef;
	}
	
	.box1, .box2 {
	  display: flex;
	  align-items: center;
	  justify-content: space-between;
	}
	
	.box1 text:first-child {
	  font-size: 32rpx;
	  color: #343434;
	}
	
	.box1 text:last-child {
	  font-size: 28rpx;
	  color: #fe7606;
	}
	
	.box2 {
	  font-size: 24rpx;
	  color: #888;
	}
	
	.pageBottom {
	  font-size: 28rpx;
	  color: #666;
	  text-align: center;
	  height: 80rpx;
	  line-height: 80rpx;
	}
	
	.swiper-tab {
	  width: 100%;
	  border-bottom: 1rpx solid #eaeaea;
	  text-align: center;
	  height: 88rpx;
	  line-height: 88rpx;
	  font-weight: bold;
	  background: #fff;
	  position: fixed;
	  top: 0;
	  left: 0;
	  z-index: 1;
	}
	
	.swiper-tab-item {
	  display: inline-block;
	  width: 50%;
	  font-size: 14px;
	  color: #999;
	  vertical-align: bottom;
	}
	
	.active {
	  color: #fe7606;
	  border-bottom: 4rpx solid #fe7606;
	}
	
	.field_text {
	  color: red;
	  margin-right: 20rpx;
	}

</style>